import java.util.Random;
import java.util.Scanner;

public class SuiJiShu {
    public static void main(String[] args){
        while(true){
            Random r = new Random();
            Scanner sc = new Scanner(System.in);
            int a = r.nextInt(100);
            System.out.println("请猜一个1~100之间数字");
            int b = sc.nextInt();
            if(b>=1&&b<=100){
                System.out.println("随机数为:"+(a+1));
                if(b>a+1){
                    System.out.println("你猜的数据大了");
                }
                else if(b<a+1){
                    System.out.println("你猜的数据小了");
                }
                else if(b==a+1){
                    System.out.println("恭喜你猜中了");
                }
            }
            else{
                System.out.println("输入错误,请输入1~100之间的数据");
            }
        }
    }
}
